// list experimental header
#pragma once
#ifndef _EXPERIMENTAL_LIST_
#define _EXPERIMENTAL_LIST_
#ifndef RC_INVOKED

#include <list>

#pragma pack(push, _CRT_PACKING)
#pragma warning(push, _STL_WARNING_LEVEL)
#pragma warning(disable : _STL_DISABLED_WARNINGS)
_STL_DISABLE_CLANG_WARNINGS
#pragma push_macro("new")
#undef new

_STD_BEGIN
namespace experimental {
    inline namespace fundamentals_v2 {

        // FUNCTION TEMPLATE erase_if
        template <class _Ty, class _Alloc, class _Pr>
        inline void erase_if(list<_Ty, _Alloc>& _Cont, _Pr _Pred) { // erase each element satisfying _Pred
            _Cont.remove_if(_Pass_fn(_Pred));
        }

        // FUNCTION TEMPLATE erase
        template <class _Ty, class _Alloc, class _Uty>
        inline void erase(list<_Ty, _Alloc>& _Cont, const _Uty& _Val) { // erase each element matching _Val
            _Cont.remove_if([&](_Ty& _Elem) { // return whether element matches _Val
                return _Elem == _Val;
            });
        }

    } // namespace fundamentals_v2
} // namespace experimental
_STD_END

#pragma pop_macro("new")
_STL_RESTORE_CLANG_WARNINGS
#pragma warning(pop)
#pragma pack(pop)

#endif // RC_INVOKED
#endif // _EXPERIMENTAL_LIST_

/*
 * Copyright (c) by P.J. Plauger. All rights reserved.
 * Consult your license regarding permissions and restrictions.
V6.50:0009 */
